Florian Müllner [Fri, 11 Aug 2023 22:03:38 +0000 (00:03 +0200)]
extensionBase: Use UUID as fallback gettext domain
Nowadays we can set up translations automatically, but only when
the domain is provided with the metadata.
This can be a problem, for example our extension templates use
the automatic translation handling that we recommend, but as a
result the code will throw an error unless `gettext-domain` is
added to the metadata.
Binding a text domain is cheap enough to not care about unnecessary
or duplicated calls, so add a final fallback to the UUID when no
domain was provided as parameter or in the metadata.
There is already a precedent with the `gnome-extensions pack` command
that falls back to the UUID when no explicit gettext domain was
included in the metadata.
Florian Müllner [Tue, 29 Aug 2023 15:54:43 +0000 (17:54 +0200)]
style: Only apply neutral entry focus color on lock screen
Commit a72c95de changed the focus style for all system entries
to a more neutral color, as the stronger focus often clashes
with the wallpaper background on the lock screen.
However that is not a concern for entries that appear over the
neutral system background. Worse, the neutral focus indication
provides so little contrast with the background there that is
not much of an indication anymore.
Address this by restoring the old focus indication for the
generic system_entry mix-in, but override it specifically on
the lock screen to avoid the clash with the wallpaper background.
Carlos Garnacho [Mon, 28 Aug 2023 17:44:11 +0000 (19:44 +0200)]
workspacesView: Skip relayouts during destruction
The WorkspacesView may be scheduled to be destroyed during
relayout, and despite that go through the allocate() vfunc.
When that happens, the ::destroy handler is called early,
so the WorkspacesView clears this._workspaces in result.
When vfunc_allocate() is called, various paths rely on the
workspaces array being still populated, which is not the
case.
The existing check at vfunc_allocate() for the WorkspacesView
having no children is insufficient, since children are destroyed
as a result, not beforehand.
This results in the following warnings when going out of
overview:
This always happens through the _updateWorkspacesViews() paths, so there
is a new WorkspacesView taking over and the one being destroyed should
silently go away.
theme: Use insensitive theming for undecorated insensitive buttons
Menu items such as "paste" when no clipboard is available were always
painted as active. This is because the undecorated buttons do not use
the insensitive color anymore.
Stuart Hayhurst [Sun, 27 Aug 2023 18:25:42 +0000 (19:25 +0100)]
osdWindow: Allow label and level to be null
Allow passing 'null' to setLevel and setLabel, so 'null' and 'undefined'
behave the same way.
Fixes a regression introduced by a42f7c23, which caused parts of old
notifications to persist into new notifications, or elements being
incorrectly made visible
Florian Müllner [Sun, 13 Aug 2023 23:08:56 +0000 (01:08 +0200)]
extensions-tool/create: Optionally include prefs
We currently only create boilerplate code for the actual
extension. Now that libadwaita has largely standardized
preference UIs, it makes sense to allow creating the
prefs.js boilerplate as well.
Florian Müllner [Sun, 13 Aug 2023 22:31:16 +0000 (00:31 +0200)]
extensions-tool/create: Create schema template
When creating an extension with --settings-schema, rather than
just adding a corresponding entry in the metadata, generate the
gschema boilerplate as well.
Carlos Garnacho [Thu, 24 Aug 2023 21:45:42 +0000 (23:45 +0200)]
windowManager: Drop AppSwitchAction
This gesture to switch the focused app was already a bit of a
compromise solution at the time it was added, its clunky way to
work (3fg long press, then taps with a 4th finger to switch
application) was pretty much picking up the remains of our
limited wiggle room (sticking to 3fg/4fg global gestures, since
2fg are application domain).
But then directional 3fg gestures took prevalence, and made it
easier to switch between applications. This small gesture remained
a bit of an easter egg, largely unused and unknown.
Fast forward to today, and it's being noticed in a bad way. The
changes to event handling and delivery to actions has made this
gesture take prevalence over the wee-bit-more-popular 3fg swipe
gestures, making those never become active and never trigger.
While a gesture framework is being investigated that might
help handle these situations (or, in a less undefined manner),
this doesn't seem like a case worth going out of our way to
hack around until that is in place. We can remove this, and make
all WM interactions go through the 3fg directional gestures.
Florian Müllner [Mon, 14 Aug 2023 22:13:34 +0000 (00:13 +0200)]
quickSettings: Add insertItemBefore() method
The QuickSettings menu currently only support appending items
at the end. Extensions can get around that limitation by accessing
the private grid property to move the item afterwards, but we don't
allow this in our own code.
Expose a new insertItemBefore() method that allows adding an item
before an existing one.
panel: Add workspaces indicators in activities button
After removing the app name and icon, the next natural step that
was requested from the design team is to add workspaces indicators
to the top bar, where currently the Activities button is placed.
In addition to that, this is desired because there are known issues
with using "Activities" as a label for the overview. A more
comprehensive rationale for that can be found at [1].
Add an workspaces indicator replacing the Activities label in the
activities button.
The WorkspaceIndicators class controls how many workspaces dots
exists, their expansion, and the width multiplier. The WorkspaceDot
class takes the expansion and the multiplier, and applies it
internally so that we can get perfectly rounded dots at all
times without using CSS hacks.
The width multipliers are hardcoded, and defined by the design
team. We can revisit them later if necessary. Special care is
taken to not let these width multipliers result in fractional
widths.
When the number of workspaces changes, WorkspaceIndicators adds
new dot to the end, and animate them. When removing, scale the dot
out, then destroy it.
This does not work with workspace grids, but that's not supported
by GNOME Shell anyway, so no effort is made to cover this use case.
The button continues to have "Activities" as its accessible name,
but the label actor is removed.
Also adjust the padding of the activities pill, so it better wraps
the new indicators.
Simon Schneegans [Thu, 17 Aug 2023 17:32:42 +0000 (19:32 +0200)]
lookingGlass: Export the Inspector class
Several extensions use this class to let the
user pick application windows. Exporting this
class will make it easier for these extensions
to be ported to GNOME 45.
Florian Müllner [Mon, 14 Aug 2023 23:55:47 +0000 (01:55 +0200)]
ci: Use sudo to run meson install
Meson stopped using polkit for automatic privilege elevation, and
will no longer attempt any priviledge elevation when not running
interactively.
Running the entire install command as root used to be problematic
in the past, as it could result in ownership changes of files in
the build directory that would result in build failures later,
but the aforementioned change leaves us with little choice.
Apparently `meson install` will spawn `ninja` with dropped
privileges when a rebuild is needed, so hopefully this will
no longer be an issue.
Brendan William [Wed, 9 Aug 2023 17:40:35 +0000 (10:40 -0700)]
weather: Prevent setting Geoclue source as location name
Prior to Geoclue v2.7, the location description did not seem to ever be
set. Now, the source used to determine the location is set as the
description. This can result in the location name in dateMenu to be set
as "WiFi", "GeoIP", etc., since we relay the description as the location
name to GWeather. Instead, pass an empty string so GWeather continues
to set the location name itself.
Chris Heywood [Sun, 21 Aug 2022 03:55:46 +0000 (13:55 +1000)]
messageList: Allow dismissal via backspace
Currently only the delete key can be used to dismiss notifications.
Some laptops don't have delete keys, resulting in needing to hit a
modifier to trigger delete.
Plus, on those keyboards that do have delete keys they're often a
little harder to strike than backspace.
Florian Müllner [Mon, 14 Aug 2023 18:39:34 +0000 (20:39 +0200)]
panel: Don't expand camera quick settings items
The camera indicator currently doesn't have any items, but if
we were to add one, it would almost certainly be a regular
toggle rather than a slider that needs expanding.
Florian Müllner [Sun, 13 Aug 2023 17:12:27 +0000 (19:12 +0200)]
extensions/shared: Don't cache detected URL
The translation functions we export from extension utils must
work with all extensions, not only the first that calls one
of the functions.
That means that we are back to examining a backtrace for every
function call unless an extension defined its own translation
functions with `import.meta.url`.
workspaceAnimation: Sync progress with main adjustment
Create a derived workspaces adjustment using the new API, and
bind it to the 'progress' property. This is only done by the
MonitorGroup representing the primary monitor.
The progress value that WorkspaceAnimation operates on
represents the percentage within the workspaceIndices array
we are, so make sure to transform the percentage to the
correct workspace index.
overviewControls: Use new workspaces adjustment API
Derive the workspaces adjustment used by OverviewControls (and
shared with WorkspacesView) from the main workspaces adjustment
using the new Main.createWorkspacesAdjustment() method.
And a way to derive "sub"-adjustments from the main one.
The main and private StAdjustment properly represents
workspaces, and has all relevant properties (lower, upper,
and value) set by the workspace manager.
The main adjustment is not bound to any particular actor,
which means we cannot call the 'ease' method directly.
Consumers of this API should create adjustments using
Main.createWorkspacesAdjustment(), and this new adjustment
is bound to the actor that the consumer passed. Consumers
must not change any property of the derived adjustment other
than the 'value' property.
The 'value' property is synchronized between all adjustments
created, which guarantees that all elements that represent
workspaces can have a shared and up-to-date understanding of
where in the workspace layout we are.
Dallas Strouse [Fri, 11 Aug 2023 15:20:53 +0000 (15:20 +0000)]
util: Export trySpawn()
It was private before, and so any users of it (including the
Background Apps menu) would fail to utilize it, making apps fail
to get told to shut down from the Background Apps menu.
Florian Müllner [Thu, 10 Aug 2023 15:50:08 +0000 (17:50 +0200)]
tests/unit: Access shell sources from resource
Unit tests currently load shell sources directly from the
filesystem.
This is currently blocking generated sources - namely config.js - to
ESM, because a relative import from the source dir will fail to
locate the file in the build dir.
Address this by using the same GResource as gnome-shell instead of
direct filesystem access, as the resource will always include all
sources files at the expected location.
Out of the members of the notification daemon(s), these are the most
necessary and flexible to override. The daemons are used as singletons
and notifications are rather temporary, while the sources are more
flexible and make the most sense to override (and revert).
Florian Müllner [Wed, 9 Aug 2023 14:24:07 +0000 (16:24 +0200)]
screenshot: Export showScreen*UI() functions
showScreenshotUI() is needed by the system action, and
showScreenRecordingUI() is conceptually so similar that
it would be odd to export one and not the other.
Florian Müllner [Mon, 7 Aug 2023 01:26:04 +0000 (03:26 +0200)]
ci: Simplify run-eslint script
Now that all code conforms with the new style, we can remove all
the tricky bits that compare errors from regular- and legacy
config or limit checks to changed lines from a git diff.
All that is left over the eslint CLI tool is the ability to output
results both as junit for gitlab and plain text for logs without
duplicating the linting, but that's well worth preserving.
Florian Müllner [Mon, 7 Aug 2023 01:24:35 +0000 (03:24 +0200)]
ci: Remove eslint_mr job
There is no longer a difference between regular- and legacy config.
That means that all code now follows the regular configuration, and
we no longer need a separate check that enforces this for new code.
Florian Müllner [Mon, 7 Aug 2023 01:15:51 +0000 (03:15 +0200)]
cleanup: Fixup wrong JSDoc comments
There are a handful of JSDoc comments that are invalid or don't
conform to the configured format. Fix them to remove the last
remaining bit of legacy configuration.
Florian Müllner [Sun, 6 Aug 2023 22:40:20 +0000 (00:40 +0200)]
cleanup: Remove spaces in object literals
We only adopted this style relatively recently, so there's a bit
more to adjust. Still, it's manageable and another step towards
getting rid of the legacy style.
Carlos Garnacho [Tue, 8 Aug 2023 22:26:52 +0000 (00:26 +0200)]
st: Mass update to ClutterActorClass event vmethod changes
These are now forwarded as ClutterEvent in order to remain accessible
on the Javascript side. This also means all ClutterActor implementations
in ST need to update to this change.
Carlos Garnacho [Tue, 8 Aug 2023 16:22:11 +0000 (18:22 +0200)]
js: Avoid Clutter.get_current_event() in Clutter.Actor event vfuncs
We sometimes obtained the current event through the general machinery
just so we could pass it along as a ClutterEvent instead of a specialized
subtype.
We now get that out of the box, so may avoid getting the current event
which is just a cast of the same current event we already have.
Carlos Garnacho [Tue, 8 Aug 2023 16:14:04 +0000 (18:14 +0200)]
js: Mass move to Clutter.Event getter methods in Clutter.Actor vfuncs
These traditionally got the various ClutterEvent subtype structs as their
argument, so it was not allowed to use ClutterEvent generic getter methods
in these vfuncs. These methods used direct access to struct fields instead.
This got spoiled with the move to make ClutterEvent opaque types, since
these are no longer public structs so GNOME Shell most silently failed to
fetch the expected values from event fields. But since they are not
ClutterEvents either, the getters could not be used on them.
Mutter is changing so that these vmethods all contain an alias to the
one and only Clutter.Event type, thus lifting those barriers, and making
it possible to use the ClutterEvent methods in these vfuncs.